package com.satis.compose.get.example
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.runtime.Composable
import com.satis.compose.get.annotation.PageRoute
import com.satis.compose.get.appComposePages
import com.satis.compose.get.example.pages.RouteNoFoundPage
import com.satis.compose.get.navigator.GetParam
import com.satis.compose.get.navigator.definedPage
import com.satis.compose.get.widget.GetApp

/**
 * @author sunshaobei on 2022/9/6
 */

@OptIn(ExperimentalAnimationApi::class)
@Composable
fun App() {
    GetApp(
        startDestination = "Main",
        routeNoFoundDestination = "/app/error"
    ) {
        appComposePages()
        definedPage(
            route="MVI",
            enter= PageRoute.Animation.LEFT_IN,
            exit= PageRoute.Animation.LEFT_OUT,
            popEnter= PageRoute.Animation.RIGHT_IN,
            popExit= PageRoute.Animation.RIGHT_OUT) {
               RouteNoFoundPage(it.arguments!!.getString(GetParam.PAGE_NO_FOUND)!!)
        }
    }
}
